﻿using SuperJoe.Framwork.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WWX.Dto.Search;
using WWX.MemberPortal.BLL;

namespace WWX.MemberPortal.Web.Controllers
{
    public class OrderController : AuthorizationController
    {
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult List(OrderSearch search, int limit, int pageIndex = 0)
        {
            int results = 0;
            var list = new OrderBLL().GetPageList(search, ++pageIndex, limit, out results);
            return this.Json(new { results, rows = list.Select(l => new { no = l.No, productInfo = l.ProductInfo, remark = l.Remark, date = l.Date.ToString(), logisticsInfo = l.LogisticsInfo, salePrice = l.SalePrice, status = l.Status.ToText(), isDeducted = l.IsDeducted, remainPaymentMoney = l.RemainPaymentMoney }) }, JsonRequestBehavior.AllowGet);
        }
    }
}